package com.practice.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.practice.pojo.user.entity.Article;
import com.practice.pojo.user.vo.ArticalHotVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    
    @Select("SELECT catename,ydd_article.id,title,pic,lovenum FROM ydd_article,ydd_cate " +
            "WHERE cateid=ydd_cate.id  ORDER BY lovenum desc LIMIT 8 ")
    List<ArticalHotVO> hot();
    
    @Select("SELECT catename,ydd_article.id,title,pic,lovenum FROM ydd_article,ydd_cate " +
            "WHERE cateid=ydd_cate.id  ORDER BY create_date desc LIMIT 8 ")
    List<ArticalHotVO> recommend();
    
}
